package com.blueocean_health.care.management.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.blueocean_health.care.management.domain.base.Hospital;
import com.blueocean_health.care.management.domain.dto.BuildDeptFloolDto;
import com.blueocean_health.care.management.domain.dto.DeptFloorDto;
import com.blueocean_health.care.management.mapper.BuildingMapper;
import com.blueocean_health.care.management.mapper.DepartmentMapper;
import com.blueocean_health.care.management.mapper.DeptBuildFloorMapper;
import com.blueocean_health.care.management.service.DeptBuildFloorService;

/**
 * 医院科室楼号楼层 四级联动  业务实现类  2017年8月24日11:47:42
 * @author wuyanli
 *
 */
@Service
public class DeptBuildFloorServiceImpl implements DeptBuildFloorService{
	
	@Autowired
	private DeptBuildFloorMapper dbfDao;
	
	@Autowired
	private BuildingMapper buildDao;
	
	@Autowired
	private DepartmentMapper deptDap;

	/**
	 * 三级联动  2017年8月28日10:59:06
	 */
	@Override
	public List<DeptFloorDto> getAllFromBuild(String hospitalId) {
		Hospital hospital = new Hospital();
		hospital.setHospitalId(hospitalId);
		List<DeptFloorDto> list=dbfDao.getAllFromBuild(hospital);
		return list;
	}

	/**
	 * 四级联动 2017年8月28日10:59:12
	 */
	@Override
	public List<DeptFloorDto> getAllFromHospital() {
		List<DeptFloorDto> allFromHospital = dbfDao.getAllFromHospital();
		return allFromHospital;
	}

	/**
	 * 根据医院Id 获取外派信息的id  2018年3月12日15:33:12
	 */
	@Override
	public BuildDeptFloolDto getWaiPaiInfo(String hospitalId) {
		BuildDeptFloolDto bdfDto = new BuildDeptFloolDto();
		String buildWaiPaiId = buildDao.getBuildWaiPaiId(hospitalId);
		String waiPaiId = deptDap.getWaiPaiId(hospitalId);
		bdfDto.setBuildId(buildWaiPaiId);
		bdfDto.setDeptId(waiPaiId);
		bdfDto.setFloorId("1060");
		return bdfDto;
	}


}
